//
//  MoreViewController.m
//  ForengnMenu
//
//  Created by @-@ on 16/1/26.
//  Copyright © 2016年 余旺. All rights reserved.
//

#import "MoreViewController.h"
#import "MoreInfoTableViewCell.h"

@interface MoreViewController ()<UITableViewDataSource,UITableViewDelegate>

@property NSArray * titles;

@property NSArray * contents;

@end

@implementation MoreViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.titles = @[@[@"昵称",@"性别",@"年龄",@"星座"],@[@"职业",@"所在地",@"个人说明"],@[@"兴趣爱好"]];
    
    self.contents = @[@[@"没什么特长",@"女",@"19岁",@"水瓶"],@[@"学生",@"湖南-长沙",@"嘴馋勤做菜，人丑多读书..."],@[@"烹饪 运动 旅游"]];

}



- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{

    return self.titles.count;

}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

    NSArray * subItems = self.titles[section];
    
    return subItems.count;

}

//视图将要出现时
-(void)viewWillAppear:(BOOL)animated{
    
    //让导航栏不透明
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@""] forBarMetrics:UIBarMetricsDefault];
    
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    static NSString * identifier = @"cell0";

    MoreInfoTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];

    cell.titleLabel.text = self.titles[indexPath.section][indexPath.row];
    
    cell.ContentTextField.text = self.contents[indexPath.section][indexPath.row];
    
    return cell;

}

//点击时触发
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    //取消选择状态
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
